package com.woniuxy.ssm.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author linke
 * @version 1.0
 * @className: RoleController
 * @description: 角色控制器
 * @date 2021/11/18 11:06
 *
 * @Controller 注册到Spring容器中，并非昨日的bean标签 id =”/first“
 * 仅仅只是在Spring中注册一个bean，名字叫做rbacManagerController,我们可以通过getBean获取到
 * 一级路由地址  localhost:8080/role/*
 */
@Controller
@RequestMapping("role")
public class RoleController {
    /**
     * 常规写法
     * @return
     */
    @RequestMapping("/findOne")
        public ModelAndView findOnefine(){
            ModelAndView modelAndView = new ModelAndView();
            modelAndView.addObject("msg","角色方法一");
            modelAndView.setViewName("/index.jsp");
            return modelAndView;
        }
        @RequestMapping("/findTwo")
        public ModelAndView findTwo(){
            ModelAndView modelAndView = new ModelAndView();
            modelAndView.addObject("msg","角色方法二");
            modelAndView.setViewName("/index.jsp");
            return modelAndView;
        }
        @RequestMapping("/first")
        public ModelAndView first() {
            ModelAndView modelAndView = new ModelAndView();
            modelAndView.addObject("msg","第一个访问方法");
            modelAndView.setViewName("/index.jsp");
            return modelAndView;
        }

}
